package com.biyu.monitormanage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biyu.monitormanage.common.utils.PageUtils;
import com.biyu.monitormanage.common.utils.Query;
import com.biyu.monitormanage.dao.MsgLogDao;
import com.biyu.monitormanage.entity.MsgLogEntity;
import com.biyu.monitormanage.entity.SysLogEntity;
import com.biyu.monitormanage.service.MsgLogService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author 15491
 */
@Service("msgLogService")
public class MsgLogServiceImpl extends ServiceImpl<MsgLogDao, MsgLogEntity> implements MsgLogService {
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String key = (String)params.get("key");

        IPage<MsgLogEntity> page = this.page(
                new Query<MsgLogEntity>().getPage(params),
                new QueryWrapper<MsgLogEntity>().like(StringUtils.isNotBlank(key),"user_id", key)
        );

        return new PageUtils(page);
    }
}
